package com.jcl.recruit.searchresume.logic;

import com.jcl.core.utils.CollectionUtils;
import com.jcl.recruit.searchresume.mapper.SearchResumeEduMapper;
import com.jcl.recruit.searchresume.model.SearchResumeEdu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @ClassName SearchResumeEduLogic
 * @Description TODO
 * @Author yyliu
 * @Date 2018/10/26 9:30
 * @Version 1.0
 **/
@Component
public class SearchResumeEduLogic implements SearchResumeEduMapper {

    @Autowired
    private SearchResumeEduMapper searchResumeEduMapper;

    @Override
    public List<Map<String, Object>> selectResumeEduListByResumeId(Integer id) {
        return searchResumeEduMapper.selectResumeEduListByResumeId(id);
    }

    @Override
    public List<SearchResumeEdu> findListByResumeId(Integer id) {
        return searchResumeEduMapper.findListByResumeId(id);
    }

    @Override
    public int batchInsertEdus(List<SearchResumeEdu> list) {
        return searchResumeEduMapper.batchInsertEdus(list);
    }

    @Override
    public int batchDeleteByResumeIds(List<Integer> ids) {
        if(CollectionUtils.isNotEmpty(ids)){
            return searchResumeEduMapper.batchDeleteByResumeIds(ids);
        }
        return 0;
    }
}
